<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="msvalidate.01" content="3667D2FEB238C1BF174F3CB1AE0D3C16" />
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
  <title><%= content_for?(:title) ? content_for(:title) : "Libraries.io - The Open Source Discovery Service" %></title>
  <meta name="description" content="<%= content_for?(:description) ? content_for(:description) : "Discover open source packages, modules and frameworks you can use in your code." %>">
  <%= csrf_meta_tags %>
  <%= content_for :atom %>
  <link rel="apple-touch-icon-precomposed" sizes="57x57" href="<%= asset_url "apple-touch-icon-57x57.png" %>" />
  <link rel="apple-touch-icon-precomposed" sizes="114x114" href="<%= asset_url "apple-touch-icon-114x114.png" %>" />
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="<%= asset_url "apple-touch-icon-72x72.png" %>" />
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="<%= asset_url "apple-touch-icon-144x144.png" %>" />
  <link rel="apple-touch-icon-precomposed" sizes="60x60" href="<%= asset_url "apple-touch-icon-60x60.png" %>" />
  <link rel="apple-touch-icon-precomposed" sizes="120x120" href="<%= asset_url "apple-touch-icon-120x120.png" %>" />
  <link rel="apple-touch-icon-precomposed" sizes="76x76" href="<%= asset_url "apple-touch-icon-76x76.png" %>" />
  <link rel="apple-touch-icon-precomposed" sizes="152x152" href="<%= asset_url "apple-touch-icon-152x152.png" %>" />
  <meta name="application-name" content="&nbsp;"/>
  <meta name="msapplication-TileColor" content="#FFFFFF" />
  <meta name="msapplication-TileImage" content="<%= asset_url "mstile-144x144.png" %>" />
  <meta name="msapplication-square70x70logo" content="<%= asset_url "mstile-70x70.png" %>" />
  <meta name="msapplication-square150x150logo" content="<%= asset_url "mstile-150x150.png" %>" />
  <meta name="msapplication-wide310x150logo" content="<%= asset_url "mstile-310x150.png" %>" />
  <meta name="msapplication-square310x310logo" content="<%= asset_url "mstile-310x310.png" %>" />
  <meta property="fb:admins" content="508462908" />
  <meta name="yandex-verification" content="2a6b144b8bd37026" />
  <%= content_for(:meta).presence || render_meta %>
  <% if content_for?(:canonical_url) %>
  <link rel="canonical" href="https://libraries.io<%= yield(:canonical_url) %>" />
  <% end %>
  <link href="/opensearch.xml" title="Libraries.io" rel="search" type="application/opensearchdescription+xml">
  <% if ENV["GA_ANALYTICS_ID"].present? %>
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
      <% if logged_in? %>
        ga('create', '<%= ENV["GA_ANALYTICS_ID"] %>', 'auto', { 'userId': <%= current_user.id %> });
      <% else %>
        ga('create', '<%= ENV["GA_ANALYTICS_ID"] %>', 'auto');
      <% end %>
    </script>
    <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=IntersectionObserver"></script>
  <% end %>
  <% if ENV["GTM_ID"].present? %>
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','<%= ENV["GTM_ID"] %>');</script>
  <% end %>
  <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
  <script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "WebSite",
      "name": "Libraries.io",
      "url": "https://libraries.io/",
      "description": "Discover open source packages, modules and frameworks you can use in your code",
      "license": "https://github.com/librariesio/libraries.io/blob/main/LICENSE.txt",
      "potentialAction": {
        "@type": "SearchAction",
        "target": "https://libraries.io/search?q={search_term_string}",
        "query-input": "required name=search_term_string"
      }
    }
  </script>
  <script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "Organization",
      "name": "Libraries.io",
      "description": "Discover open source packages, modules and frameworks you can use in your code",
      "url": "https://libraries.io/",
      "logo": "<%= asset_url "apple-touch-icon-152x152.png" %>",
      "email": "support@libraries.io",
      "sameAs": [
        "https://twitter.com/librariesio",
        "https://www.facebook.com/libraries.io",
        "https://github.com/librariesio",
        "https://plus.google.com/101868076054784591044"
      ]
    }
  </script>
</head>
<body>
  <div class="navbar navbar-inverse navbar-static-top">
    <div class="container">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-main">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <%= link_to image_tag('logo.svg', width: 116, height: 22), root_path, class: 'navbar-brand' %>
      </div>
      <div class="navbar-collapse collapse" id="navbar-main">
        <% unless on_homepage? && !logged_in? %>
          <ul class="nav navbar-nav navbar-left">
            <li class=' <%= 'hidden-xs' if on_search_page %>'>
              <%= render 'projects/search_form' %>
            </li>
          </ul>
        <% end %>
        <ul class="nav navbar-nav navbar-right">
          <% if logged_in? %>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><%= image_tag current_user.avatar_url(40), width: 20, height: 20 %> <span class="caret"></span></a>
              <ul class="dropdown-menu">
                <li><%= link_to 'Subscriptions', subscriptions_path %></li>
                <% if current_user.github_enabled? %>
                  <li><%= link_to 'Repository Monitoring', repositories_path %></li>
                  <% if current_user.repository_user.present? %>
                    <li><%= link_to 'Profile', user_path(current_user.repository_user.to_param) %></li>
                  <% end %>
                <% end %>
                <li><%= link_to 'Settings', account_path %></li>
                <li><%= link_to 'Logout', logout_path %></li>
              </ul>
            </li>
          <% else %>
            <li>
              <div class="navbar-btn btn-group">
                <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                  Login <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                  <li>
                    <%= link_to login_path(host_type: 'github', return_to: request.original_url) do %>
                      <%= fa_icon('github') %> GitHub
                    <% end %>
                  </li>
                  <li>
                    <%= link_to login_path(host_type: 'gitlab', return_to: request.original_url) do %>
                      <%= fa_icon('gitlab') %> GitLab
                    <% end %>
                  </li>
                  <li>
                    <%= link_to login_path(host_type: 'bitbucket', return_to: request.original_url) do %>
                      <%= fa_icon('bitbucket') %> Bitbucket
                    <% end %>
                  </li>
                  <li class='divider'></li>
                  <li class="dropdown-header terms">
                    By logging in you accept <br>our <a href='/terms'>terms of service</a> <br>and <a href='/privacy'>privacy policy</a>
                  </li>
                </ul>
              </div>
            </li>
          <% end %>
        </ul>
      </div>
    </div>
  </div>

  <div class="container">
    <%= render 'shared/flash' %>
    <%= yield %>
  </div>
  <%= render 'layouts/footer' %>

  <script>
    if (typeof ga === 'function') { ga('send', 'pageview', location.pathname+location.search) }
  </script>
</body>
</html>
